import Vue from 'vue'
import VueRouter from 'vue-router'
import IndexLayout from '../layout/IndexLayout.vue'
import Music from '../pages/music.vue'
import HotList from '../pages/HotList.vue'
import PlayMv from '../pages/PlayMv.vue'
import HotListDetails from '../pages/HotListDetails.vue'

import Home from '../pages/Home.vue'
import Search from '../pages/Search.vue'
import Details from '../components/Details.vue'
import WeatherDetails from '../pages/WeatherDetails.vue'
import HistoryDetails from '../pages/HistoryDetails.vue'
import SubscriptionDetails from '../pages/SubscriptionDetauls.vue'

import Login from '../pages/Login.vue'
import Logon from '../pages/Logon.vue'
import User from '../pages/User.vue'
import ChangePas from "../pages/Changed.vue"
import Personal from "../pages/Personal.vue"
import Look from "../pages/Look.vue"
import collection from "../pages/Collection.vue"
import Forget from "../pages/Forget.vue"
import History from "../pages/HistoryRecord.vue"
Vue.use(VueRouter);

const routes = [
  {
    path: '',
    redirect: '/index'
  },
  {
    path: '/index',
    component: IndexLayout,
    children: [
      {
        path: '',
        redirect: 'home'
      },
      {
        path: 'home',
        component: Home
      },
      {
        path: '/HotList',
        component: HotList,
        
      },
      {
        path:'subscriptionDetails/:categoryId',
        component:SubscriptionDetails,
        name:'subscriptionDetails'
      }
    ]
  },
  {
    path: '/music',
    component: Music
  },
  {
    path: '/play-mv/:id',
    component: PlayMv,
    name: 'play-mv'
  },
  {
    path: '/hotlistdetails/:id',
    component: HotListDetails,
    name: 'hotlistdetails'
  },
  {
    path: '/search',
    component: Search
  },
  {
    path: '/Login',
    component: Login,
    name: "Loging"
  },
  {
    path: '/logon',
    component: Logon,
    name: "Logon"
  },
  {
    path: '/user',
    component: User,
    name: "User"
  },
  {
    path: '/details/:articleId',
    component: Details,
    name: 'details'
  },

  {
    path: "/Change/:title",
    component: ChangePas,
    name: "change"
  },
  {
    path: "/Personal/:title",
    component: Personal,
    name: "Personal"
  },
  {
    path: "/Look/:title",
    component: Look,
    name: "Look"
  },
  {
    path: "/collection/:title",
    component: collection,
    name: "collection"
  },
  {
    path: "/forget",
    component: Forget,
    name: "forget"

  },
  {
    path: '/weatherDetails',
    component: WeatherDetails
  },
  {
    path: '/historyDetails/:index',
    component: HistoryDetails,
    name: 'historyDetails'
  },
  {
    path:'/histor/:title',
    component:History,
    name:"History"
  }
];

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
});

export default router
